package com.le.tester.niuke;

import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties;

/**
 * createTime：2021/12/10 9:24
 * description：偶数奇数异常
 */
public class RetDemo {
    public static String sRet = "";

    public static void func(int i) {
        try {
            if (i % 2 == 0) {
                //抛异常走进catch；catch完之后还是会使用finally
                throw new Exception();
            }
        } catch (Exception e) {
            sRet += "0";
            return;
        } finally {
            sRet += "1";
        }
        sRet += "2";
    }

    public static void main(String[] args) {
        func(1);
        func(2);
        System.out.println(sRet);
    }
}
